Skip to content

modbus: add nxmodbus#3459

Merged
acassis merged 1 commit into
apache:masterfrom
raiden00pl:nxmodbus
Apr 20, 2026
Merged

modbus: add nxmodbus#3459
acassis merged 1 commit into
apache:masterfrom
raiden00pl:nxmodbus

Conversation

@raiden00pl

Copy link
Copy Markdown
Member

Summary

NxModbus is a lightweight Modbus protocol stack implementation for NuttX RTOS.

This commit adds:

  • nxmodbus stack
  • nxmbserver - Modbus Server (Slave) example
  • nxmbclient - Modbus Client (Master) tool

Supported Modbus transports:

  • ASCII
  • RTU over serial port
  • TCP
  • RAW (ADU) for custom transport implementations

It takes some concepts from FreeModBus and some from Zephyr Modbus implementation.

Impact

new modbus stack

Testing

simulator for RTU, qemu-intel64 for TCP, nucleo-c071rb for RTU.

response time on nucleo-c071rb is 10-20ms so it fixes my main issue with freemodbus #3037:
image

@raiden00pl

Copy link
Copy Markdown
Member Author

here two scripts in python that can be used for testing:

dummy_master.py
dummy_slave.py

@cederom

cederom commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Whoah! Amazing work BIG THANK YOU @raiden00pl !! =)

Can we put the python test scripts under nuttx/tools/modbus? These are very handy for testing and I created something like that myself too. Would be nice to have them in the repo :-)

Very popular GUI open-source modbus client application is https://sourceforge.net/projects/qmodmaster/.

@acassis acassis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raiden00pl Amazing work! Kudos!

Comment thread modbus/nxmodbus/core/nxmb_context.c Outdated
Comment thread industry/nxmodbus/core/nxmb_func.c
Comment thread modbus/nxmodbus/core/nxmb_func_diag.c Outdated
Comment thread industry/nxmodbus/transport/nxmb_crc.c

@masc2008 masc2008 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this is a great feature!

Comment thread industry/nxmodbus/core/nxmb_client.c
@raiden00pl

Copy link
Copy Markdown
Member Author

@cederom I don't like the idea of ​​putting app-specific things in the NuttX repo, but I can include these in nuttx-apps if you find it useful

NxModbus is a lightweight Modbus protocol stack implementation for NuttX RTOS.

This commit adds:
- nxmodbus stack
- nxmbserver - Modbus Server (Slave) example
- nxmbclient - Modbus Client (Master) tool

Supported Modbus transports:
- ASCII
- RTU over serial port
- TCP
- RAW (ADU) for custom transport implementations

Signed-off-by: raiden00pl <raiden00@railab.me>
@acassis acassis merged commit 773f69d into apache:master Apr 20, 2026
41 checks passed
@cederom

cederom commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Thank you @raiden00pl I am prototyping a new board right now, it should be ready this week maybe next week, then I will play with your stack, thank you again for sharing your solution!! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] New Modbus implementation for NuttX [BUG] Modbus RTU slave response time is too high

6 participants